Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
promise-map-series
Advanced tools
Call an iterator function for each element of an array in series, ensuring that no iterator is called before the promise returned by the previous iterator is fulfilled, in effect preventing parallel execution. Like async.mapSeries, but for promises.
npm install --save promise-map-series
var mapSeries = require('promise-map-series')
mapSeries(array, iterator[, thisArg]).then(function (newArray) {
...
})
array
: An array of values (should not be promises).
iterator
: Function that returns a promise or a value for the new
array. The iterator
will be called once for each element. If iterator
returns a promise, then iterator
will only be called for the next element
once that promise is fulfilled. If the promise is rejected or iterator
throws an error, iteration will stop immediately and mapSeries
returns a
rejected promise. The iterator
function receives three arguments:
item
: The current item in the array.
index
: The current index in the array.
array
: The original array
argument.
thisArg
(optional): Value to use as this
when executing iterator
.
FAQs
Map over array avoiding parallel execution, using promises
The npm package promise-map-series receives a total of 766,213 weekly downloads. As such, promise-map-series popularity was classified as popular.
We found that promise-map-series demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.